From 7a676cdc14ae854f8fd6817bdaa99ae88df56973 Mon Sep 17 00:00:00 2001 From: Rafal Luzynski Date: Fri, 4 Sep 2015 11:21:08 +0200 Subject: [PATCH] flow box: Fix bad children allocation with RTL locales If the position of the children is always relative to the box then we should not take the allocation of the box into account when flipping the children for RTL text direction. This patch also removes unused assignments to child_allocation. https://bugzilla.gnome.org/show_bug.cgi?id=754559 --- gtk/gtkflowbox.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 8b65d65ecf..f53e908c00 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -1606,11 +1606,6 @@ gtk_flow_box_size_allocate (GtkWidget *widget, gint i, this_line_size; GSequenceIter *iter; - child_allocation.x = 0; - child_allocation.y = 0; - child_allocation.width = 0; - child_allocation.height = 0; - gtk_widget_set_allocation (widget, allocation); window = gtk_widget_get_window (widget); if (window != NULL) @@ -1618,10 +1613,6 @@ gtk_flow_box_size_allocate (GtkWidget *widget, allocation->x, allocation->y, allocation->width, allocation->height); - child_allocation.x = 0; - child_allocation.y = 0; - child_allocation.width = allocation->width; - min_items = MAX (1, priv->min_children_per_line); if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) @@ -1938,7 +1929,7 @@ gtk_flow_box_size_allocate (GtkWidget *widget, } if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width; + child_allocation.x = allocation->width - child_allocation.x - child_allocation.width; gtk_widget_size_allocate (child, &child_allocation); item_offset += this_item_size; -- 2.30.2